package per.hnvcam.common;

import java.util.Collection;
import java.util.SortedSet;

public interface OrderedSet<T> extends Iterable<T>, Collection<T>, SortedSet<T> {
  /**
    * Remove item at specified position.
    * @param position
    * @return
    */
   T removeAt(int position);

   /**
    * Returns the position of specified item.
    * @param item
    * @return
    */
   int indexOf(T item);

   /**
    * Returns true if this set contains no elements.
    * @return
    */
   boolean isEmpty();

   /**
    * Returns the number of elements in this set (its cardinality)
    * @return
    */
   int size();

   /**
    * Returns the element at the specified position in this set.
    * @param position
    * @return
    */
   T getAt(int position);

   /**
    * Set the order of this set. Default is ascending.
    * @param isAscending
    */
   void setAscendingSort(boolean isAscending);

   /**
    * Returns true if this set is sorted by ascending order.
    * @return
    */
   boolean isAscendingSort();
}
